package com.supermarket.manage.common.dto.ucenter.request;

import com.supermarket.manage.common.validation.CheckGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author Faxon
 * @version 1.0
 * @date 2020-02-27 19:08
 **/
@Data
@ApiModel("RegisterParams:客户注册对象")
public class RegisterParams implements Serializable {

    private static final long serialVersionUID = -1653343157801783078L;
    /**
     * 超市名称
     */
    @NotBlank(message = "超市名称不能为空", groups = CheckGroup.Add.class)
    @ApiModelProperty(value = "超市名称")
    private String shopName;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空", groups = CheckGroup.Add.class)
    @ApiModelProperty(value = "用户名")
    private String username;

    /**
     * 密码，加密存储
     */
    @NotBlank(message = "密码不能为空", groups = CheckGroup.Add.class)
    @ApiModelProperty(value = "密码")
    private String password;

    /**
     * 注册手机号
     */
    @Pattern(regexp = CheckGroup.PHONE_VALIDATE, message = "手机号码格式错误", groups = CheckGroup.Add.class)
    @NotBlank(message = "手机号码不能为空", groups = CheckGroup.Add.class)
    @ApiModelProperty(value = "注册手机号")
    private String phone;

    /**
     * 手机验证码
     */
    @NotBlank(message = "手机验证码不能为空", groups = CheckGroup.Add.class)
    @ApiModelProperty(value = "手机验证码")
    private String code;
}
